home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 112_01.zip / NRO.H < prev    next >
Text File  |  1993-06-19  |  6KB  |  166 lines

  1. /*
  2.  *    Parameter file for NRO word processor
  3.  *
  4.  *    Stephen L. Browning
  5.  *    5723 North Parker Avenue
  6.  *    Indianapolis, Indiana 46220
  7.  */
  8.  
  9. #define MACRO     0    /* macro definition */
  10. #define BP     1    /* begin page    */
  11. #define BR     2    /* break    */
  12. #define CE     3    /* center    */
  13. #define FI     4    /* fill        */
  14. #define FO     5    /* footer    */
  15. #define HE     6    /* header    */
  16. #define IN     7    /* indent    */
  17. #define LS     8    /* line spacing    */
  18. #define NF     9    /* no fill    */
  19. #define PL    10    /* page lenght    */
  20. #define RM    11    /* right margin    */
  21. #define SP    12    /* line space    */
  22. #define TI    13    /* temp indent    */
  23. #define UL    14    /* underline    */
  24. #define JU    15    /* justify    */
  25. #define NJ    16    /* no justify    */
  26. #define M1    17    /* top margin    */
  27. #define M2    18    /* second top margin    */
  28. #define M3    19    /* first bottom margin    */
  29. #define M4    20    /* bottom-most margin    */
  30. #define BS    21    /* allow/disallow '\b' in output */
  31. #define NE    22    /* need n lines */
  32. #define PC    23    /* page number character */
  33. #define CC    24    /* control character    */
  34. #define PO    25    /* page offset    */
  35. #define BO    26    /* bold face    */
  36. #define EH    27    /* header for even numbered pages    */
  37. #define OH    28    /* header for odd numbered pages    */
  38. #define EF    29    /* footer for even numbered pages    */
  39. #define OF    30    /* footer for odd numbered pages    */
  40. #define SO    31    /* source file    */
  41. #define CU    32    /* continuous underline    */
  42. #define DE    33    /* define macro    */
  43. #define EN    34    /* end macro definition    */
  44. #define NR    35    /* set number register    */
  45.  
  46. #define UNKNOWN    -1
  47.  
  48. /*
  49.  *    MAXLINE is set to a value slightly larger
  50.  *    than twice the longest expected input line.
  51.  *    Because of the way underlining is handled, the
  52.  *    input line which is to be underlined, can almost
  53.  *    triple in length.  Unlike normal underlining and
  54.  *    boldfacing, continuous underlining affects all
  55.  *    characters in the buffer, and represents the
  56.  *    worst case condition.  If the distance between
  57.  *    the left margin and the right margin is greater
  58.  *    than about 65 characters, and continuous underlining
  59.  *    is in effect, there is a high probability of buffer
  60.  *    overflow.
  61.  */
  62.  
  63. #define MAXLINE    200
  64. #define PAGELEN     66
  65. #define PAGEWIDTH 80
  66. #define HUGE    256
  67. #define LEFT    0        /* indecies into header margin limit arrays */
  68. #define RIGHT    1
  69. #define NFILES    4        /* nesting depth for input files */
  70.  
  71. /*
  72.  *    The following parameters may be defined in bdscio.h
  73.  */
  74.  
  75. #define YES    1
  76. #define NO    0
  77. #define ERR    -1
  78.  
  79. /*
  80.  *    The parameter values selected for macro definitions
  81.  *    are somewhat arbitrary.  MACBUF is the storage area
  82.  *    for both macro names and definitions.  Since macro
  83.  *    processing is handled by pushing back the expansion
  84.  *    into the input buffer, the longest possible expansion
  85.  *    would be MAXLINE characters.  Allowing for argument
  86.  *    expansion, MXMLEN was chosen slightly less than MAXLINE.
  87.  *    It is assumed that most macro definitions will not
  88.  *    exceed 20 characters, hence MXMDEF of 100.
  89.  */
  90.  
  91. #define MXMDEF    100        /* maximum no. of macro definitions */
  92. #define MACBUF    2000        /* macro definition buffer */
  93. #define MXMLEN    150        /* maximum length of each macro definition */
  94. #define MNLEN    10        /* maximum length of macro name */
  95.  
  96. struct macros {
  97.     char *mnames[MXMDEF];    /* table of pointers to macro names */
  98.     int lastp;        /* index to last mname    */
  99.     char *emb;        /* next char avail in macro defn buffer */
  100.     char mb[MACBUF];    /* table of macro definitions */
  101.     char *ppb;        /* pointer into push back buffer */
  102.     char pbb[MAXLINE];    /* push back buffer */
  103. };
  104.  
  105.  
  106. /* control parameters for nro */
  107.  
  108. struct docctl {
  109.     int fill;    /* fill if YES, init = YES        */
  110.     int lsval;    /* current line spacing, init = 1    */
  111.     int inval;    /* current indent, >= 0, init = 0    */
  112.     int rmval;    /* current right margin, init = 60    */
  113.     int tival;    /* current temp indent, init = 0    */
  114.     int ceval;    /* number of lines to center, init = 0    */
  115.     int ulval;    /* number of lines to underline, init = 0 */
  116.     int cuval;    /* no. lines to continuously underline, init = 0 */
  117.     int juval;    /* justify if YES, init = YES        */
  118.     int boval;    /* number of lines to bold face, init = 0 */
  119.     int bsflg;    /* can output contain '\b', init = FALSE */
  120.     char pgchr;    /* page number character, init = '#'    */
  121.     char cmdchr;    /* command character, init = '.'    */
  122.     int prflg;    /* print on or off, init = TRUE        */
  123.     int sprdir;    /* direction for spread(), init = 0    */
  124.     int flevel;    /* nesting depth for source cmd, init = 0 */
  125.     int nr[26];    /* number registers    */
  126. };
  127.  
  128.  
  129. /* output buffer control parameters */
  130.  
  131. struct cout {
  132.     int outp;    /* next avail char position in outbuf, init = 0 */
  133.     int outw;    /* width of text currently in buffer    */
  134.     int outwds;    /* number of words in buffer, init = 0    */
  135.     int lpr;    /* output to printer, init = FALSE    */
  136.     char outbuf[MAXLINE];    /* output of filled text    */
  137. };
  138.  
  139. /* page control parameters for nro */
  140.  
  141. struct page {
  142.     int curpag;    /* current output page number, init =0    */
  143.     int newpag;    /* next output page number, init = 1    */
  144.     int lineno;    /* next line to be printed, init = 0    */
  145.     int plval;    /* page length in lines, init = 66    */
  146.     int m1val;    /* margin before and including header    */
  147.     int m2val;    /* margin after header            */
  148.     int m3val;    /* margin after last text line        */
  149.     int m4val;    /* bottom margin, including footer    */
  150.     int bottom;    /* last live line on page
  151.                     = plval - m3val - m4val    */
  152.     int offset;    /* page offset from left, init = 0    */
  153.     int frstpg;    /* first page to print, init = 0    */
  154.     int lastpg;    /* last page to print, init = 30000    */
  155.     int ehlim[2];    /* left/right margins for headers/footers    */
  156.     int ohlim[2];    /* init = 0 and PAGEWIDTH            */
  157.     int eflim[2];
  158.     int oflim[2];
  159.     char ehead[MAXLINE];    /* top of page title, init = '\n'    */
  160.     char ohead[MAXLINE];
  161.     char efoot[MAXLINE];    /* bottom of page title, init = '\n'    */
  162.     char ofoot[MAXLINE];
  163. };
  164.  
  165. char *getmac();
  166.